package com.kadron.application;

import com.kadron.datamodel.KModel;
import com.kadron.entity.Application;
import com.kadron.entity.KApplicationImage;

public class KApplicationModel implements KModel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 209196151902743344L;

	private Application application;
	private KApplicationImage img;
	
	public KApplicationModel(Application application, KApplicationImage image) {
		super();
		this.application = application;
		this.img = image;
	}

	@Override
	public long getId() {
		return application.getId();
	}

	public Application getApplication() {
		return application;
	}

	public void setApplication(Application application) {
		this.application = application;
	}

	public KApplicationImage getImg() {
		return img;
	}

	public void setImg(KApplicationImage image) {
		this.img = image;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (application.getId() ^ (application.getId() >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		KApplicationModel other = (KApplicationModel) obj;
		if (application.getId() != other.application.getId())
			return false;
		return true;
	}
	
}
